package com.mc.moring.login;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.text.Editable;
import android.text.InputType;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.google.gson.Gson;
import com.mc.moring.R;
import com.mc.moring.app.LogUtils;
import com.mc.moring.base.BaseActivity;
import com.mc.moring.base.HttpBitmapCallback;
import com.mc.moring.base.HttpCallback;
import com.mc.moring.bean.AppConfigBean;
import com.mc.moring.bean.CheckMobileZiLiPageRegister;
import com.mc.moring.bean.ZiLiPageLoginBean;
import com.mc.moring.bean.ZiLiPageUserDataBean;
import com.mc.moring.bean.getWebLinkConfigBean;
import com.mc.moring.event.UpdateUserEvent;
import com.mc.moring.login.modle.LoginModle;
import com.mc.moring.main.MainActivity;
import com.mc.moring.main.WebViewActivity;
import com.mc.moring.main.modle.MianModle;
import com.mc.moring.util.AppManager;
import com.mc.moring.util.GsonUtils;
import com.mc.moring.util.IntentUtils;
import com.mc.moring.util.PointMgr;
import com.mc.moring.util.SPUtils;
import com.mc.moring.util.SharePreUtil;
import com.mc.moring.util.T;
import com.mc.moring.util.ToastUtils;

import org.greenrobot.eventbus.EventBus;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.HashMap;
import java.util.Map;

public class LoginActivity extends BaseActivity {

    private TextView back;

    private TextView rightText;
    private TextView mTvButton;
    private TextView mTvLength;
    private EditText mEtPhone;
    private TextView mTvAreaNumber;
    private TextView mTvAccountShow;
    private ImageView mIvFlag;
    private LinearLayout mLlaccount;
    private LinearLayout mLlPassword;
    private ImageView mIvLookUp;
    private EditText mEtPassword;
    private TextView mTvForgotPassword, right_text, tv_login;

    private LinearLayout mLlVerify;

    private View mUnderLine;

    private View tvLine;

    private ImageView mIvVerify;

    private EditText mEtValidate;

    private ImageView mIvValidate;

    private ImageView mIvRefreshVerify;

    private String account = "";
    private String password = "";
    private String captcha = "";
    private int errorNum = 0;
    private boolean look_up = false;

    private boolean isAccount = false;
    LoginModle loginModle = null;

    CheckMobileZiLiPageRegister checkMobileZiLiPageRegister = null;
    private int tabIndex = 0;

    private getWebLinkConfigBean urlBean;
    private AppConfigBean appConfigBean;

    private TextView tvPhoneError;
    private boolean passwordPageStop = false;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        PointMgr.INSTANCE.sendEvent("cl_login_entrance_yes");
        Log.e("PointMgr.INSTANCE.sendEvent","cl_login_entrance_yes");
        LogUtils.logE("login page");
        setContentView(R.layout.activity_login);
        loginModle = LoginModle.Companion.getInstant();
        SharedPreferences sharedPreferences = getSharedPreferences("firstTime", Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putString("firstTime","false");
        editor.commit();
        init();
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    public Activity getActivity() {
        return this;
    }


    @Override
    public void initView() {
        AppManager.getAppManager().addActivity(this);
        SharePreUtil.saveStringData("webName","");
        SharePreUtil.saveStringData("webPhone","");
        mTvButton = findViewById(R.id.tv_button);
        mTvLength = findViewById(R.id.tv_length);
        mEtPhone = findViewById(R.id.et_phone);
        mTvAreaNumber = findViewById(R.id.tv_area_number);
        mIvFlag = findViewById(R.id.iv_flag);
        mTvAccountShow = findViewById(R.id.tv_account_show);
        back = findViewById(R.id.backImage);
        rightText = findViewById(R.id.right_text);
        mLlaccount = findViewById(R.id.ll_account);
        mLlPassword = findViewById(R.id.ll_password);
        mIvLookUp = findViewById(R.id.iv_look_up);
        tvLine = findViewById(R.id.tv_line);
        mEtPassword = findViewById(R.id.et_password);
        mTvForgotPassword = findViewById(R.id.tv_forgot_password);
        mLlVerify = findViewById(R.id.ll_verify);
        mUnderLine = findViewById(R.id.underline);
        mIvVerify = findViewById(R.id.iv_verify);
        mIvValidate = findViewById(R.id.iv_validate);
        mIvRefreshVerify = findViewById(R.id.iv_refresh_verify);
        mEtValidate = findViewById(R.id.et_validate);
        tv_login = findViewById(R.id.tv_login);
        tvPhoneError = findViewById(R.id.tv_phone_error);

        if (look_up) {
            mEtPassword.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
        } else {
            mEtPassword.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
        }

        mEtPassword.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View view, boolean b) {
                Log.e("----2", String.valueOf(b));
            }
        });

        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (tabIndex == 1) {
                    tabIndex = 0;
                    isAccount = false;
                    mLlaccount.setVisibility(View.VISIBLE);
                    mLlPassword.setVisibility(View.GONE);
                    tv_login.setVisibility(View.GONE);
                    mTvAccountShow.setText("Iniciar sesión Registrarse");
                } else {
                    Intent intent = new Intent(LoginActivity.this, MainActivity.class);
                    startActivity(intent);
                    finish();
                }
                if ( passwordPageStop ){
                    passwordPageStop = false;
                    PointMgr.INSTANCE.sendEvent("cl_reunter_step_17_open");
                    Log.e("PointMgr.INSTANCE.sendEvent","cl_reunter_step_17_open");
                }
            }
        });
        tv_login.setOnClickListener(v -> {
            PointMgr.INSTANCE.sendEvent("cl_reunter_step_20_open");
            Log.e("PointMgr.INSTANCE.sendEvent","cl_reunter_step_20_open");
            Intent intent = new Intent(LoginActivity.this, VerifyActivity.class);
            intent.putExtra("account", account);
            intent.putExtra("type", "1");
            intent.putExtra("scenes", "login");
            startActivity(intent);
        });
        mTvButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                LogUtils.logE("mTvButton-> onclick" );
                PointMgr.INSTANCE.sendEvent("cl_loogn_entrance_out_click");
                Log.e("PointMgr.INSTANCE.sendEvent","cl_loogn_entrance_out_click");
                closeIme();
                if (!isAccount) {
                    account = mEtPhone.getText().toString();
                    if (TextUtils.isEmpty(account)) {
                        isAccount = false;
                        return;
                    }
                    showLoading();
                    loginModle.getLoginZiLiPageData("56", account, new HttpCallback() {
                        @Override
                        public void onSuccess(@NonNull String data) {
                            checkMobileZiLiPageRegister = new Gson().fromJson(data, CheckMobileZiLiPageRegister.class);
                            if (!checkMobileZiLiPageRegister.getCode().equals("0000")) {
                                runOnUiThread(new Runnable() {
                                    @Override
                                    public void run() {
                                        ToastUtils.showShort(LoginActivity.this, checkMobileZiLiPageRegister.getMsg());
                                    }
                                });
                                return;
                            }
                            if (checkMobileZiLiPageRegister != null && checkMobileZiLiPageRegister.getData() != null) {
                                if (Boolean.FALSE.equals(checkMobileZiLiPageRegister.getData().getRegisterFlag())) {
                                    PointMgr.INSTANCE.sendEvent("cl_mommikle_unregistered");
                                    Log.e("PointMgr.INSTANCE.sendEvent","cl_mommikle_unregistered");
                                    Intent intent = new Intent(LoginActivity.this, VerifyActivity.class);
                                    intent.putExtra("account", account);
                                    intent.putExtra("type", "1");
                                    intent.putExtra("scenes", "register");
                                    startActivity(intent);
                                } else {
                                    PointMgr.INSTANCE.sendEvent("cl_moooki_registered");
                                    Log.e("PointMgr.INSTANCE.sendEvent","cl_moooki_registered");
                                    runOnUiThread(new Runnable() {
                                        @Override
                                        public void run() {
                                            tabIndex = 1;
                                            account = mEtPhone.getText().toString();
                                            isAccount = true;
                                            mLlaccount.setVisibility(View.GONE);
                                            mLlPassword.setVisibility(View.VISIBLE);
                                            tv_login.setVisibility(View.VISIBLE);
                                            mEtPassword.setText("");
                                            mEtValidate.setText("");
                                            if ( mLlVerify.getVisibility() == View.VISIBLE ){
                                                getZiLiPageCaptcha();
                                            }

                                            mEtPassword.setFocusable(true);
                                            mTvAccountShow.setText("Iniciar sesión");
                                            PointMgr.INSTANCE.sendEvent("cl_reunter_step_16_open");
                                            Log.e("PointMgr.INSTANCE.sendEvent","cl_reunter_step_16_open");
                                            passwordPageStop = true;
                                        }
                                    });

                                }
                            }
                            hideLoading();
                        }

                        @Override
                        public void onFaill(@NonNull String e) {
                            LogUtils.logE("login fail e " + e);
                            hideLoading();
                        }
                    });
                } else {
                    ZiLiPagelogin();
                    Log.e("----login","1");
                }
            }
        });

        mTvForgotPassword.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                closeIme();
                Intent intent = new Intent(LoginActivity.this, VerifyActivity.class);
                intent.putExtra("account", account);
                intent.putExtra("type", "1");
                intent.putExtra("scenes","resetPassword");
                startActivity(intent);
                PointMgr.INSTANCE.sendEvent("cl_reunter_step_21_open");
                Log.e("PointMgr.INSTANCE.sendEvent","cl_reunter_step_21_open");
            }
        });

        rightText.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                showHelp();

            }
        });

        mIvLookUp.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                look_up = !look_up;
                if (look_up) {
                    mIvLookUp.setImageResource(R.drawable.icon_look_down);
                    mEtPassword.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
                } else {
                    mIvLookUp.setImageResource(R.drawable.icon_look_up);
                    mEtPassword.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);

                }
            }
        });

        mEtPhone.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View view, boolean hasFocus) {
                if (hasFocus) {
                    PointMgr.INSTANCE.sendEvent("cl_mikioe_input_focus");
                    Log.e("PointMgr.INSTANCE.sendEvent","cl_mikioe_input_focus");
                }
            }
        });


        mEtPhone.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
            }

            @Override
            public void afterTextChanged(Editable s) {
                String phone = s.toString();

                if (mEtPhone.getText() != null) {
                    String ss = String.format("%s/9", phone.length());
                    mTvLength.setText(ss);
                }

                if (!TextUtils.isEmpty(phone) && phone.charAt(0) != '9' ) {
                    tvPhoneError.setVisibility(View.VISIBLE);
                    tvPhoneError.setText("Ingrese el número celular correcto");
                    tvLine.setBackgroundColor(Color.parseColor("#4DFF3737"));
                } else {
                    tvPhoneError.setVisibility(View.GONE);
                    tvLine.setBackgroundColor(Color.parseColor("#33000000"));
                }

                if (!TextUtils.isEmpty(phone) && phone.length() == 9 && phone.charAt(0) == '9' ) {
                    mTvButton.setEnabled(true);
                    mTvButton.setBackgroundResource(R.drawable.bg_gradient_b4ffcc_76efff_corner_8);
                } else {
                    mTvButton.setEnabled(false);
                    mTvButton.setBackgroundResource(R.drawable.bg_f4f4f4_corner_8);
                }
            }
        });

        mEtPassword.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                PointMgr.INSTANCE.sendEvent("cl_reunter_step_18_open");
                Log.e("PointMgr.INSTANCE.sendEvent","cl_reunter_step_18_open");
            }
        });
//        mIvValidate.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                getZiLiPageCaptcha();
//                PointMgr.INSTANCE.sendEvent("cl_reunter_step_19_open");
//                Log.e("PointMgr.INSTANCE.sendEvent","cl_reunter_step_19_open");
//
//            }
//        });
        mIvRefreshVerify.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                getZiLiPageCaptcha();
                PointMgr.INSTANCE.sendEvent("cl_reunter_step_19_open");
                Log.e("PointMgr.INSTANCE.sendEvent","cl_reunter_step_19_open");
            }
        });
    }

    @Override
    public void initData() {

        Intent intent = getIntent();
        if (intent != null) {
            String mobile = intent.getStringExtra("mobile");
            if (!TextUtils.isEmpty(mobile)) {
                mEtPhone.setText(mobile);
                String ss = String.format("%s/9", mobile.length());
                mTvLength.setText(ss);
            }
        }

        urlBean = new Gson().fromJson(SharePreUtil.getStringData("_getWebLinkConfig"),getWebLinkConfigBean.class);
        Map<String, String> params = new HashMap<>();
        showLoading();
        MianModle.Companion.getInstant().securitygetApplicationConfig(params, new HttpCallback(){

            @Override
            public void onFaill(@NonNull String e) {
                hideLoading();
            }

            @Override
            public void onSuccess(@NonNull String data) {
                try {
                    JSONObject jsonObject = new JSONObject(data);
                    if (MianModle.Companion.getInstant().isSuccess(jsonObject)){
                        appConfigBean = GsonUtils.INSTANCE.getGson().fromJson(data, AppConfigBean.class);

                    }
                } catch (Exception e){
                    e.printStackTrace();
                }
                hideLoading();
            }
        });
    }

    private void backgroundAlpha(float f) {
        WindowManager.LayoutParams lp = getWindow().getAttributes();
        lp.alpha = f;
        getWindow().setAttributes(lp);
    }

    private void showHelp() {
        closeIme();
        View view = View.inflate(this, R.layout.popowin_help_list, null);
        PopupWindow popupWindow = new PopupWindow(view, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);
        popupWindow.showAtLocation(rightText, Gravity.BOTTOM, 0, 0);
        WindowManager.LayoutParams lp = getWindow().getAttributes();
        lp.alpha = 0.5f;
        getWindow().setAttributes(lp);
        TextView tv_tv1 = view.findViewById(R.id.tv_tv1);
        TextView tv_tv2 = view.findViewById(R.id.tv_tv2);
        TextView tv_tv3 = view.findViewById(R.id.tv_tv3);
        TextView tv_tv4 = view.findViewById(R.id.tv_tv4);
        TextView tv_tv5 = view.findViewById(R.id.tv_tv5);
        tv_tv1.setOnClickListener(v -> {
            popupWindow.dismiss();
            Intent intent = new Intent();
            intent.setClass(this, WebViewActivity.class);
            intent.putExtra("url", urlBean.getData().getFacebookUrl());
            startActivity(intent);
        });
        tv_tv2.setOnClickListener(v -> {
            popupWindow.dismiss();
            String phoneNumber = appConfigBean.getData().getWhatApp();
            Intent intent = new Intent(Intent.ACTION_DIAL);
            intent.setData(Uri.parse("tel:"+phoneNumber));
            startActivity(intent);

        });
        tv_tv3.setOnClickListener(v -> {
            popupWindow.dismiss();

            String phoneNumber = appConfigBean.getData().getContactNumber();
            Intent intent = new Intent(Intent.ACTION_DIAL);
            intent.setData(Uri.parse("tel:"+phoneNumber));
            startActivity(intent);

        });
        tv_tv4.setOnClickListener(v -> {
            popupWindow.dismiss();

            try {
                IntentUtils.openMail(this, appConfigBean.getData().getContactEmail());
            } catch (Exception e) {
                e.printStackTrace();
                ToastUtils.showLong(this, "No hay aplicación de buzón");
            }

        });
        tv_tv5.setOnClickListener(v -> {
            Intent intent = new Intent();
            intent.setClass(this, WebViewActivity.class);
            intent.putExtra("url", urlBean.getData().getFeedbackUrl());
            startActivity(intent);
            popupWindow.dismiss();
        });
        popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
            @Override
            public void onDismiss() {
                backgroundAlpha(1.0f);
            }
        });
    }

    private void ZiLiPagelogin() {
        PointMgr.INSTANCE.sendEvent("cl_login_click_tab_1");
        Log.e("PointMgr.INSTANCE.sendEvent","cl_login_click_tab_1");
        password = mEtPassword.getText().toString().trim();

        captcha = mEtValidate.getText().toString().trim();
        if (mLlVerify.getVisibility() == View.VISIBLE) {
                if (TextUtils.isEmpty(captcha) || captcha.length() != 4) {
                        ToastUtils.showShort(LoginActivity.this, "Introduzca el Código de verificación correcto");
                        return;
                    }
            } else {
                captcha = "";
            }
        LogUtils.logE("params password>" + password + "  captcha>" + captcha);
        showLoading();
        loginModle.getZiLiPagesecurityLogin(account, password, this, captcha, new HttpCallback() {
            @Override
            public void onSuccess(@NonNull String data) {
                LogUtils.logE("login success data>" + data);
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            JSONObject jsonObject = new JSONObject(data);
                            if (loginModle.isSuccess(jsonObject)) {
                                JSONObject jsonData = jsonObject.optJSONObject("data");
                                if (jsonData != null) {
                                    SPUtils.INSTANCE.setPhone(jsonData.optString("mobile"));
                                    ZiLiPageUserDataBean userDataBean = new ZiLiPageUserDataBean();
                                    userDataBean.setData(jsonData, LoginActivity.this);
                                    ZiLiPageUserDataBean.setInstance(userDataBean);
                                    finish();
                                }
                            } else {
                                T.showShort(LoginActivity.this, loginModle.getStringToJson(jsonObject, "msg"));
                            }
                        } catch (JSONException e) {
                            e.printStackTrace();
                        }
                        Log.e("----loginFail", "2");
                        errorNum++;

                        ZiLiPageLoginBean loginBean = new Gson().fromJson(data, ZiLiPageLoginBean.class);
                        if (TextUtils.equals(loginBean.getCode(), "0000")) {
                            if (loginBean.getData() == null) {
                                return;
                            }
                            LogUtils.logE("kelvin ---loginBean.getData()--" + loginBean.getData());
                            ZiLiPageUserDataBean.setInstance(loginBean.getData());
//                            JSONObject jsonObject = null;
//                            try {
//                                jsonObject = new JSONObject(data);
//                                JSONObject jsonData = jsonObject.optJSONObject("data");
//                                ZiLiPageUserDataBean userDataBean = new ZiLiPageUserDataBean();
//                                userDataBean.setData(jsonObject, LoginActivity.this);
//                            } catch (JSONException e) {
//                                throw new RuntimeException(e);
//                            }

                            startActivity(MainActivity.class);
                            EventBus.getDefault().post(new UpdateUserEvent());
                            return;
                        }
                        else if (TextUtils.equals(loginBean.getCode(), "10003") && errorNum < 2) {
                            errorNum = 2;
                        }
                        if ( mLlVerify.getVisibility() == View.VISIBLE ){
                            getZiLiPageCaptcha();
                        } else if (errorNum >= 2) {
                            getZiLiPageCaptcha();
                        }
                    }
                });
                hideLoading();
            }

            @Override
            public void onFaill(@NonNull String e) {
                hideLoading();
                Log.e("----loginFail","1");
            }
        });

    }

    private void getZiLiPageCaptcha() {
        showLoading();
        loginModle.getZiLiPageCaptcha(account, "login",new HttpBitmapCallback() {
            @Override
            public void onSuccess(@NonNull Bitmap data) {
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        mLlVerify.setVisibility(View.VISIBLE);
                        mUnderLine.setVisibility(View.VISIBLE);
                        mIvValidate.setImageBitmap(data);
                    }
                });
                hideLoading();
            }

            @Override
            public void onFaill(@NonNull String e) {
                hideLoading();
            }
        });

    }


    @Override
    public void onBackPressed() {
        LogUtils.logE("tabIndex>>>" + tabIndex);
        if (tabIndex == 1) {
            tabIndex = 0;
            isAccount = false;
            mLlaccount.setVisibility(View.VISIBLE);
            mLlPassword.setVisibility(View.GONE);
            tv_login.setVisibility(View.GONE);
            mTvAccountShow.setText("Iniciar sesión Registrarse");
        } else {
            Intent intent = new Intent(LoginActivity.this, MainActivity.class);
            startActivity(intent);
            finish();
        }
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        if (ev.getAction() == MotionEvent.ACTION_DOWN) {
            View currentFocus = getCurrentFocus();
            if (currentFocus instanceof EditText) {
                EditText editText = (EditText) currentFocus;
                if (!isInSide(editText, ev) && isSoftInPutDisplayed()) {
                    closeIme();
                }
            }
        }
        return super.dispatchTouchEvent(ev);
    }

    private Boolean isInSide(View currentFocus, MotionEvent ev) {
        int[] location = {0,0};
        currentFocus.getLocationInWindow(location);
        int left = location[0];
        int top = location[1];
        int right = left + currentFocus.getWidth();
        int bottom = top + currentFocus.getHeight();
        return (ev.getX() >= left && ev.getX() <= right && ev.getY() > top && ev.getY() < bottom);

    }

    private Boolean isSoftInPutDisplayed() {
        WindowInsetsCompat insetsCompat = ViewCompat.getRootWindowInsets(getWindow().getDecorView());
        return insetsCompat != null && insetsCompat.isVisible(WindowInsetsCompat.Type.ime());
    }

    private void closeIme() {
        if (getActivity().getCurrentFocus() == null) {
            return;
        }

        ((InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
    }

    @Override
    protected void onStop(){
        super.onStop();
        hideLoading();
        if ( passwordPageStop ){
            PointMgr.INSTANCE.sendEvent("cl_reunter_step_17_open");
            Log.e("PointMgr.INSTANCE.sendEvent","cl_reunter_step_17_open");
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        PointMgr.INSTANCE.sendEvent("cl_login_entrance_no");
        Log.e("PointMgr.INSTANCE.sendEvent","cl_login_entrance_no");
    }
}
